import request from '@/utils/request'

const api = {
  user: '/user',
  updateUser: '/user/updateUser',
  permission: '/permission',
  permissionNoPager: '/permission/no-pager',
  orgTree: '/org/tree',
  // 获取帖子1(系统管理员使用，搜索的数据为所有数据)
  news: '/news/getAllNews',
  topic: '/gossip/selectListGossip',
  club: '/clubActivity/getAllClubActivity',
  partTime: '/partTime/getAllPartTime',
  sponsor: '/sponsor/selectListSponsor',
  lost: '/lostFound/selectListLostFound',
  // 获取帖子1(个人使用，搜索的数据为个人发布数据)
  privateNews: '/news/selectMyListNews',
  privateTopic: '/gossip/selectMyListGossip',
  privateClub: '/clubActivity/selectMyListClubActivity',
  privateGroupClub: '/clubActivity/selectMyClubActivity',
  privatePartTime: '/partTime/selectMyListPartTime',
  privateSponsor: '/sponsor/selectMyListSponsor',
  privateLost: '/lostFound/selectMyListLostFound',
  // 更新帖子
  updateNews: '/news/updateNews',
  updateTopic: '/gossip/updateGossip',
  updateClub: '/clubActivity/updateClubActivity',
  updatePartTime: '/partTime/updatePartTime',
  updateSponsor: '/sponsor/updateSponsor',
  updateLost: 'lostFound/updateLostFound',
  // 删除帖子
  deleteNews: '/news/deleteNews',
  deleteTopic: '/gossip/deleteGossip',
  deleteClub: '/clubActivity/deleteClubActivity',
  deletePartTime: '/partTime/deletePartTime',
  deleteSponsor: '/sponsor/deleteSponsor',
  deleteLost: '/lostFound/deleteLostFound',
  // 搜索帖子
  selectNews: '/news/searchNews',
  selectTopic: '/gossip/selectGossipWrapper',
  selectClub: '/clubActivity/searchViewClubActivity',
  selectPartTime: '/partTime/searchPartTime',
  selectSponsor: '/sponsor/searchSponsor',
  selectLost: '/lostFound/searchLostFound',
  // 获取图片
  getPicture: '/picture',
  getAllSlideShow: '/slideShow/getAllSlideShow',
  updateSlideShow: '/slideShow/updateSlideShow',
  // rbac管理
  getRoleAuthority: '/roleAuthority/getAllRoleAuthority',
  getAllLog: '/accessLog/getAllAccessLog',
  searchLogs: '/accessLog/searchAccessLog',
  getAllUserRole: '/userRole/getAllUserRole',
  getAllRole: '/role/getAllRole',
  disUserRole: '/userRole/disUserRole',
  searchUserRole: '/userRole/searchUserRole',
  searchRole: '/role/searchRole',
  searchRoleAuthority: '/roleAuthority/searchRoleAuthority',
  updateUserRole: '/userRole/updateUserRole',
  updateRole: '/role/updateRole',
  updateAuthority: '/authority/updateAuthority',
  updateRoleAuthority: '/roleAuthority/updateRoleAuthority',
  getAllAuthority: '/authority/getAllAuthority',
  deleteAuthority: '/authority/deleteAuthority',
  searchAuthority: '/authority/searchListAuthority',
  disAuthority: '/authority/disAuthority',
  addAuthority: '/authority/addAuthority',
  getAllPermissionsUrl: '/authority/getAllPermissionsUrl',
  getAllUrl: '/authority/getAllUrl',
  delUserRole: '/userRole/delUserRole',
  deleteRole: '/role/deleteRole',
  disRole: '/role/disRole',
  addRole: '/role/addRole',
  disRoleAuthority: '/roleAuthority/disRoleAuthority',
  removeRoleAuthority: '/roleAuthority/removeRoleAuthority',

  // 用户账号管理
  checkPassword: '/user/check',
  editPassword: '/user/password',
  getAllUsers: '/user/getAllUsers',
  updateUsers: '/user/updateUsers',
  delUsers: '/user/deleteUsers',
  updateAuthentication: '/authentication/updateAuthentication',
  getAllAuthentication: '/authentication/getAllAuthentication',
  addAuthentication: '/authentication/addAuthentication',
  searchAuthentication: '/authentication/searchAuthentication',
  searchUsers: '/user/searchUser',
  getAllFeedBack: '/feedBack/getAllFeedBack',
  updateFeedBack: '/feedBack/updateFeedBack',
  delFeedBack: '/feedBack/delFeedBack',

  // 公告管理
  getAllAnnouncement: '/announcement/getAllAnnouncement',
  searchAnnouncement: '/announcement/searchAnnouncement',
  updateAnnouncement: '/announcement/updateAnnouncement',
  delAnnouncement: '/announcement/delAnnouncement',
  addAnnouncement: '/announcement/addAnnouncement'
}

export default api

// 获取所有权限名
export function getAllUrl () {
  return request({
    url: api.getAllUrl,
    method: 'get'
  })
}

// 获取所有权限名+url
export function getAllPermissionsUrl () {
  return request({
    url: api.getAllPermissionsUrl,
    method: 'get'
  })
}

// 获取所有的轮播图
export function getAllSlideShow () {
  return request({
    url: api.getAllSlideShow,
    method: 'get'
  })
}

// 获取所有公告信息
export function getAllAnnouncement (parameter) {
  return request({
    url: api.getAllAnnouncement,
    method: 'post',
    data: parameter
  })
}

// 搜索所有公告信息
export function searchAnnouncement (parameter) {
  return request({
    url: api.searchAnnouncement,
    method: 'post',
    data: parameter
  })
}

// 增加公告信息
export function addAnnouncement (parameter) {
  return request({
    url: api.addAnnouncement,
    method: 'post',
    data: parameter
  })
}

// 删除公告信息
export function delAnnouncement (parameter) {
  return request({
    url: api.delAnnouncement,
    method: 'post',
    data: parameter
  })
}

// 更新公告信息
export function updateAnnouncement (parameter) {
  return request({
    url: api.updateAnnouncement,
    method: 'post',
    data: parameter
  })
}

// 获取所有用户信息
export function getAllUsers (parameter) {
  return request({
    url: api.getAllUsers,
    method: 'post',
    data: parameter
  })
}

// 禁用权限
export function deleteAuthority (parameter) {
  return request({
    url: api.deleteAuthority,
    method: 'post',
    data: parameter
  })
}

// 禁用权限
export function disAuthority (parameter) {
  return request({
    url: api.disAuthority,
    method: 'post',
    data: parameter
  })
}

// 获取所有权限信息
export function getAllAuthority (parameter) {
  return request({
    url: api.getAllAuthority,
    method: 'post',
    data: parameter
  })
}

// 搜索所有权限信息
export function searchAuthority (parameter) {
  return request({
    url: api.searchAuthority,
    method: 'post',
    data: parameter
  })
}

// 增加角色
export function addRole (parameter) {
  return request({
    url: api.addRole,
    method: 'post',
    data: parameter
  })
}

// 增加权限
export function addAuthority (parameter) {
  return request({
    url: api.addAuthority,
    method: 'post',
    data: parameter
  })
}

// 获取所有认证信息
export function getAllAuthentication (parameter) {
  return request({
    url: api.getAllAuthentication,
    method: 'post',
    data: parameter
  })
}

// 更新角色权限
export function updateRoleAuthority (parameter) {
  return request({
    url: api.updateRoleAuthority,
    method: 'post',
    data: parameter
  })
}

// 更新认证信息
export function updateAuthentication (parameter) {
  return request({
    url: api.updateAuthentication,
    method: 'post',
    data: parameter
  })
}

// 搜素认证信息
export function searchAuthentication (parameter) {
  return request({
    url: api.searchAuthentication,
    method: 'post',
    data: parameter
  })
}

// 新增认证信息
export function addAuthentication (parameter) {
  return request({
    url: api.addAuthentication,
    method: 'post',
    data: parameter
  })
}

// 管理员更新用户信息
export function updateUsers (parameter) {
  return request({
    url: api.updateUsers,
    method: 'post',
    data: parameter
  })
}

// 管理员搜索用户信息
export function searchUsers (parameter) {
  return request({
    url: api.searchUsers,
    method: 'post',
    data: parameter
  })
}

// 管理员删除用户信息
export function delUsers (parameter) {
  return request({
    url: api.delUsers,
    method: 'post',
    data: parameter
  })
}

// 更新反馈信息的情况
export function updateFeedBack (parameter) {
  return request({
    url: api.updateFeedBack,
    method: 'post',
    data: parameter
  })
}

// 更新反馈信息的情况
export function delFeedBack (parameter) {
  return request({
    url: api.delFeedBack,
    method: 'post',
    data: parameter
  })
}

// 更新用户信息
export function updateUser (parameter) {
  return request({
    url: api.updateUser,
    method: 'post',
    data: parameter
  })
}

// 获取所有反馈
export function getAllFeedBack (parameter) {
  return request({
    url: api.getAllFeedBack,
    method: 'post',
    data: parameter
  })
}

// 禁用角色权限
export function disRoleAuthority (parameter) {
  return request({
    url: api.disRoleAuthority,
    method: 'post',
    data: parameter
  })
}

// 删除角色权限
export function removeRoleAuthority (parameter) {
  return request({
    url: api.removeRoleAuthority,
    method: 'post',
    data: parameter
  })
}

// 禁用角色
export function disRole (parameter) {
  return request({
    url: api.disRole,
    method: 'post',
    data: parameter
  })
}

// 删除角色
export function deleteRole (parameter) {
  return request({
    url: api.deleteRole,
    method: 'post',
    data: parameter
  })
}

// 删除用户的角色
export function delUserRole (parameter) {
  return request({
    url: api.delUserRole,
    method: 'post',
    data: parameter
  })
}

// 更新轮播图顺序
export function updateSlideShow (parameter) {
  return request({
    url: api.updateSlideShow,
    method: 'post',
    data: parameter
  })
}

// 禁用用户角色
export function disUserRole (parameter) {
  return request({
    url: api.disUserRole,
    method: 'post',
    data: parameter
  })
}

// 搜索权限信息
export function searchRoleAuthority (parameter) {
  return request({
    url: api.searchRoleAuthority,
    method: 'post',
    data: parameter
  })
}

// 更新权限信息
export function updateAuthority (parameter) {
  return request({
    url: api.updateAuthority,
    method: 'post',
    data: parameter
  })
}

// 更新角色信息
export function updateRole (parameter) {
  return request({
    url: api.updateRole,
    method: 'post',
    data: parameter
  })
}

export function getPicture (parameter) {
  return request({
    url: api.getPicture,
    method: 'post',
    data: parameter
  })
}

// 更新用户角色
export function updateUserRole (parameter) {
  return request({
    url: api.updateUserRole,
    method: 'post',
    data: parameter
  })
}

// 搜索角色
export function searchRole (parameter) {
  return request({
    url: api.searchRole,
    method: 'post',
    data: parameter
  })
}

// 搜索用户角色
export function searchUserRole (parameter) {
  return request({
    url: api.searchUserRole,
    method: 'post',
    data: parameter
  })
}

// 校验旧密码
export function checkPassword (parameter) {
  return request({
    url: api.checkPassword,
    method: 'post',
    data: parameter
  })
}

// 修改密码
export function editPassword (parameter) {
  return request({
    url: api.editPassword,
    method: 'post',
    data: parameter
  })
}

// 搜素访问日志
export function searchLogs (parameter) {
  return request({
    url: api.searchLogs,
    method: 'post',
    data: parameter
  })
}

// 获取访问日志
export function getAllLogs (parameter) {
  return request({
    url: api.getAllLog,
    method: 'post',
    data: parameter
  })
}

// 获取角色的权限
export function getRoleAuthority (parameter) {
  return request({
    url: api.getRoleAuthority,
    method: 'post',
    data: parameter
  })
}

// 获取角色
export function getAllRole (parameter) {
  return request({
    url: api.getAllRole,
    method: 'post',
    data: parameter
  })
}

// 获取用户的角色
export function getAllUserRole (parameter) {
  return request({
    url: api.getAllUserRole,
    method: 'post',
    data: parameter
  })
}

// 获取帖子数据
export function getAllNews (parameter) {
  return request({
    url: api.news,
    method: 'post',
    data: parameter
  })
}

export function getAllTopic (parameter) {
  return request({
    url: api.topic,
    method: 'post',
    data: parameter
  })
}

export function getAllClub (parameter) {
  return request({
    url: api.club,
    method: 'post',
    data: parameter
  })
}

export function getAllPartTime (parameter) {
  return request({
    url: api.partTime,
    method: 'post',
    data: parameter
  })
}

export function getAllSponsor (parameter) {
  return request({
    url: api.sponsor,
    method: 'post',
    data: parameter
  })
}

export function getAllLost (parameter) {
  return request({
    url: api.lost,
    method: 'post',
    data: parameter
  })
}

// 获取个人帖子数据
export function getAllPrivateNews (parameter) {
  return request({
    url: api.privateNews,
    method: 'post',
    data: parameter
  })
}

export function getAllPrivateTopic (parameter) {
  return request({
    url: api.privateTopic,
    method: 'post',
    data: parameter
  })
}

export function getAllPrivateClub (parameter) {
  return request({
    url: api.privateClub,
    method: 'post',
    data: parameter
  })
}

export function getAllPrivateGroupClub (parameter) {
  return request({
    url: api.privateClub,
    method: 'post',
    data: parameter
  })
}

export function getAllPrivatePartTime (parameter) {
  return request({
    url: api.privatePartTime,
    method: 'post',
    data: parameter
  })
}

export function getAllPrivateSponsor (parameter) {
  return request({
    url: api.privateSponsor,
    method: 'post',
    data: parameter
  })
}

export function getAllPrivateLost (parameter) {
  return request({
    url: api.privateLost,
    method: 'post',
    data: parameter
  })
}
// 修改帖子

export function updateNews (parameter) {
  return request({
    url: api.updateNews,
    method: 'post',
    data: parameter
  })
}

export function updateTopic (parameter) {
  return request({
    url: api.updateTopic,
    method: 'post',
    data: parameter
  })
}

export function updatePartTime (parameter) {
  return request({
    url: api.updatePartTime,
    method: 'post',
    data: parameter
  })
}

export function updateClub (parameter) {
  return request({
    url: api.updateClub,
    method: 'post',
    data: parameter
  })
}

export function updateSponsor (parameter) {
  return request({
    url: api.updateSponsor,
    method: 'post',
    data: parameter
  })
}

export function updateLost (parameter) {
  return request({
    url: api.updateLost,
    method: 'post',
    data: parameter
  })
}

// 删除帖子
export function deleteNews (parameter) {
  return request({
    url: api.deleteNews,
    method: 'post',
    data: parameter
  })
}

export function deletePartTime (parameter) {
  return request({
    url: api.deletePartTime,
    method: 'post',
    data: parameter
  })
}

export function deleteLost (parameter) {
  return request({
    url: api.deleteLost,
    method: 'post',
    data: parameter
  })
}

export function deleteClub (parameter) {
  return request({
    url: api.deleteClub,
    method: 'post',
    data: parameter
  })
}

export function deleteSponsor (parameter) {
  return request({
    url: api.deleteSponsor,
    method: 'post',
    data: parameter
  })
}

export function deleteTopic (parameter) {
  return request({
    url: api.deleteTopic,
    method: 'post',
    data: parameter
  })
}

// 搜索帖子
export function selectNews (parameter) {
  return request({
    url: api.selectNews,
    method: 'post',
    data: parameter
  })
}

export function selectLost (parameter) {
  return request({
    url: api.selectLost,
    method: 'post',
    data: parameter
  })
}

export function selectTopic (parameter) {
  return request({
    url: api.selectTopic,
    method: 'post',
    data: parameter
  })
}

export function selectPartTime (parameter) {
  return request({
    url: api.selectPartTime,
    method: 'post',
    data: parameter
  })
}

export function selectClub (parameter) {
  return request({
    url: api.selectClub,
    method: 'post',
    data: parameter
  })
}

export function selectSponsor (parameter) {
  return request({
    url: api.selectSponsor,
    method: 'post',
    data: parameter
  })
}
